From 528546733f1da859cb8041829abe0ae677d9a46d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Sun, 16 Aug 2009 22:24:00 +0200 Subject: [PATCH] Fix gdk_window_get_geometry for native children with non-native parent gdk_window_get_geometry calls the native function for all non-native windows. This returns coords relative to the native parent. We need to convert this to be relative to the client side parent. This fixes DnD coordinates in firefox (bug 588437). --- gdk/gdkwindow.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index f42cc75ebd..a31d570dd6 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -7272,7 +7272,7 @@ gdk_window_get_geometry (GdkWindow *window, gint *height, gint *depth) { - GdkWindowObject *private; + GdkWindowObject *private, *parent; if (!window) { @@ -7289,9 +7289,19 @@ gdk_window_get_geometry (GdkWindow *window, if (!GDK_WINDOW_DESTROYED (window)) { if (gdk_window_has_impl (private)) - GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_geometry (window, x, y, - width, height, - depth); + { + GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_geometry (window, x, y, + width, height, + depth); + /* This reports the position wrt to the native parent, we need to convert + it to be relative to the client side parent */ + parent = private->parent; + if (!gdk_window_has_impl (parent)) + { + *x -= parent->abs_x; + *y -= parent->abs_y; + } + } else { if (x) -- 2.30.2